package com.ruoyi.xuexiao.controller;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.xuexiao.domain.param.KsFileDtoParam;
import com.ruoyi.xuexiao.domain.param.KsYgJctRequestParam;
import com.ruoyi.xuexiao.domain.vo.KsYgJctReturnVo;
import com.ruoyi.xuexiao.service.KsYgJctService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.List;

/**
 * 遥感检测图
 *
 * @author 郭梓强
 * @since  2024年5月28日09:04:12
 */
@Api(tags = "遥感检测图")
@AllArgsConstructor
@RestController
public class KsYgJctController {
    private KsYgJctService ksYgJctService;


    /**
     * 获取遥感监测图
     *
     * @author 郭梓强
     * @since  2024年5月28日09:04:12
     */
    @ApiOperation("获取遥感监测图")
    @GetMapping("/jgKsYgJct/selJgKsFile")
    @ApiResponse(code = 200, message = "获取矿山文件", response = KsYgJctReturnVo.class)
    public R<List<KsYgJctReturnVo>> selJgKsFile(KsYgJctRequestParam ksYgJctRequestParam) {
        return  R.ok(ksYgJctService.selJgKsFile(ksYgJctRequestParam));
    }

    /**
     * 上传遥感检测图
     *
     * @author 郭梓强
     * @since  2024年5月28日09:04:12
     */
    @ApiOperation("上传遥感检测图")
    @PostMapping("/jgKsYgJct/jgJgKsYgJct")
    @ApiResponse(code = 200, message = "上传遥感检测图", response = KsFileDtoParam.class)
    public String jgUploadFile(KsFileDtoParam ksFileDtoParam, HttpServletRequest request) throws IOException {
        return ksYgJctService.jgJgKsYgJct(ksFileDtoParam, request);
    }

    /**
     * 删除-遥感检测图
     *
     * @author 郭梓强
     * @since  2024年5月28日09:04:12
     */
    @ApiOperation("删除-遥感检测图")
    @GetMapping("/jgKsYgJct/delJgKsYgJct")
    @ApiResponse(code = 200, message = "删除-遥感检测图", response = Boolean.class)
    @ApiImplicitParam(name = "id", value = "删除-遥感检测图id", type = "Integer")
    public R<Boolean> delJgKsYgJct(Integer id) {
        return R.ok(ksYgJctService.delJgKsYgJct(id));
    }
}
